USE BMIG_Mensual_POST_CADENA
go

IF OBJECT_ID('dbo.WASP_M0016_Create_Taable') IS NOT NULL 
   BEGIN
      DROP PROCEDURE dbo.WASP_M0016_Create_Taable 
      IF OBJECT_ID('dbo.WASP_M0016_Create_Taable') 
      IS
      NOT NULL 
         PRINT '<<< FAILED DROPPING PROCEDURE dbo.WASP_M0016_Create_Taable >>>'
      ELSE
         PRINT '<<< DROPPED PROCEDURE dbo.WASP_M0016_Create_Taable >>>' 
   END
go

SET ANSI_NULLS ON
go

SET QUOTED_IDENTIFIER ON
go

CREATE PROCEDURE WASP_M0016_Create_Taable 
AS
   BEGIN
      IF EXISTS (SELECT * 
                FROM dbo.sysobjects 
                WHERE id = OBJECT_ID(N'[dbo].[colocacion_segvida]') 
                AND OBJECTPROPERTY(id, N'IsUserTable') = 1) 
      
      DROP TABLE [dbo].[colocacion_segvida]
      
      CREATE TABLE [dbo].[colocacion_segvida](
         Nombre_Tra	  CHAR(40),
         Rut varchar (10),
         Fecha_Nac decimal(8, 0),
         Sexo	  varchar(1),
         n_cuotas varchar(2),
         prima_cobrada varchar(9),
         fecha_colocacion decimal(8, 0),
         fecha_ult_venc decimal(8, 0),
         suc_colocacion varchar(2),
         numero_credito varchar(9),
         direccion varchar(40),
         telefono varchar(9) 
      ) 
   END
go



SET ANSI_NULLS OFF
go

SET QUOTED_IDENTIFIER OFF
go

IF OBJECT_ID('dbo.WASP_M0016_Create_Taable') IS NOT NULL 
   PRINT '<<< CREATED PROCEDURE dbo.WASP_M0016_Create_Taable >>>' 
ELSE
   PRINT '<<< FAILED CREATING PROCEDURE dbo.WASP_M0016_Create_Taable >>>'
go
